//从浏览器上面取
var cityArr = JSON.parse(localStorage.getItem("cityArr")); //城市
var communication = JSON.parse(localStorage.getItem("communication")); //沟通记录
var schoolArr = JSON.parse(localStorage.getItem("schoolArr")); //学校
var depArr = JSON.parse(localStorage.getItem("depArr")); //部门
var employeeArr = JSON.parse(localStorage.getItem("employeeArr")); //员工

//localStorage.setItem('communication',JSON.stringify(communication));
var Identity = parseInt(sessionStorage.getItem("Identity"));
if (Identity == 2) {
    $('#shenhe').css('display', 'none');
}

//使用方法
addCityList();
Liandong();
addDelInfo();
bianli();
addSchoolInfo();
updateInfo();
showSchoolInfo();
addGouTongJiLu();
applyProject();
checkApply();
loseBlur();



//界面城市列表获取值
function addCityList() {
    var cityArr = JSON.parse(localStorage.getItem("cityArr")); //城市
    //遍历城市数组cityArr取值
    var cities = []; //空数组用来存放获取的城市
    for (let i = 0; i < cityArr.length; i++) {
        cities.push(cityArr[i].cityName);
    }
    //遍历城市后将城市添加到列表里
    for (let i = 0; i < cities.length; i++) {
        $('#d_list').append(`<li>${cities[i]}</li>`);
    }
}

//学校管理主界面，实现数据联动
function Liandong() {
    //城市列表li集合
    var liArr = $('#d_list').children();

    //遍历界面里城市列表的li
    for (var j = 0; j < liArr.length; j++) {
        liArr[j].index = j;

        $(liArr[j]).click(function() {

            $('#d_list').children().css('background-color', 'transparent');
            $(this).css('backgroundColor', '#1E90FF');
            //$(this).css('color','#ffffff');
            //清空
            $('.tableAll tbody tr').remove();

            //点击的li的索引
            var suoyin = this.index;
            //console.log(suoyin);//+1

            //选择某个城市后，获取该城市有哪些学校等信息
            for (var k = 0; k < schoolArr.length; k++) {
                if (suoyin + 1 === schoolArr[k].cityId) {
                    var SchoolName = schoolArr[k].schoolName;
                    var Headmaster = schoolArr[k].headmaster;
                    var Time = schoolArr[k].time;
                    var Status = schoolArr[k].status;
                    $('.tableAll tbody').append(`<tr>
                            <td>${SchoolName}</td>
                            <td>${Headmaster}</td>
                            <td>${Time}</td>
                            <td>${Status}</td>
                            <td>
                                <button class="btn btn-default lookBtn" type="submit">查看</button>
                                <!--<button class="btn btn-default addBtn" type="submit">增加</button>-->
                                <button class="btn btn-success updateBtn" type="submit" >修改</button>
                                <button class="btn btn-primary delBtn" type="submit">删除</button>
                            </td>
                        </tr>`);
                }
            }
        })
    }
}

//删除数据
function addDelInfo() {
    $('.tableAll').on('click', '.delBtn', function() {
        if (confirm('确定删除吗？')) {
            //$(this).css('outline','none');
            //表格中移除数据,找到tr
            $(this).parent().parent().remove();
            //数组中删除数据
            //找到删除按钮所在行唯一的学校名字
            var schoolname = $(this).parent().parent().children().eq(0).text();
            var schoolId; //学校id
            //console.log(schoolname)
            //删除学校数组里面的学校
            for (let i = 0; i < schoolArr.length; i++) {
                if (schoolname == schoolArr[i].schoolName) {
                    schoolId = schoolArr[i].id;
                    schoolArr.splice(i, 1);
                }
            }
            //删除被删除的学校为他添加的沟通记录
            for (let j = 0; j < communication.length; j++) {
                if (schoolId == communication[j].schoolid) {
                    communication.splice(j, 1);
                }
            }
        }

        localStorage.setItem('schoolArr', JSON.stringify(schoolArr));
        localStorage.setItem('communication', JSON.stringify(communication));
    })
}

//负责部门、负责人、所属城市联动取值
function bianli() {

    var depArr = JSON.parse(localStorage.getItem("depArr")); //部门
    var cityArr = JSON.parse(localStorage.getItem("cityArr")); //城市
    var employeeArr = JSON.parse(localStorage.getItem("employeeArr")); //员工
    //遍历部门数组
    var fuzebumen = [];
    for (let i = 0; i < depArr.length; i++) {
        if (depArr[i].depName == '市场部') {
            fuzebumen.push(depArr[i].depName);
        }

    }
    //console.log(fuzebumen)
    for (let j = 0; j < fuzebumen.length; j++) {
        $('#fuzebumen').append(`<option>${fuzebumen[j]}</option>`)
    }

    //遍历城市
    var suoshuchengshi = [];
    for (let i = 0; i < cityArr.length; i++) {
        suoshuchengshi.push(cityArr[i].cityName);
    }
    for (let j = 0; j < suoshuchengshi.length; j++) {
        $('#suoshuchengshi').append(`<option>${suoshuchengshi[j]}</option>`)
    }

    //遍历负责人
    var principal = [];
    for (let k = 0; k < employeeArr.length; k++) {
        if (employeeArr[k].eDepId == '2') {
            principal.push(employeeArr[k].eName);
        }

    }
    var newPrincipal = Array.from(new Set(principal)); //数组去重
    for (let i = 0; i < newPrincipal.length; i++) {
        $('#fuzeren').append(`<option>${newPrincipal[i]}</option>`);
    }

}

//录入新学校
function addSchoolInfo() {
    //判断手机号的正则表达式
    var reg = /^1[3|5|7|8|9]\d{9}$/;
    //录入新学校按钮
    $('#luru').click(function() {

            /*$('#luru').css('outline','none');
            $('#luru').css('border','none');*/
            $('#luruModal').modal("show");
            $('.tableAll tbody tr').remove();

            $('#sname').val('');
            $('#saddr').val('');
            $('#tel').val('');
            $('#tnum').val('');
            $('#kdll').val('');
            $('#hm').val('');
            $('#stunum').val('');
            $('#ip').val('');
            $('#zt').val('');
            $('#lutime').val('');
            $('#shuoming').val('');

            //清空提示信息
            $('#sname').next().text('');
            $('#tel').next().text('');
        })
        //保存按钮事件
    $('#addschool').click(function() {

        if ($('#sname').val().length == 0) {
            $('#sname').next().text('不能为空');
            $('#sname').next().css('color', 'red');

            return;
        } else if (!reg.test($('#tel').val())) {
            $('#tel').next().text('格式不正确');
            $('#tel').next().css('color', 'red');
            return;
        } else {
            //隐藏模态框
            $('#luruModal').modal("hide");

            //获取文本框输入的数据
            var schName = $('#sname').val();
            var schaddr = $('#saddr').val();
            var tel = $('#tel').val();
            var teaNum = $('#tnum').val();
            var kuandai = $('#kdll').val();
            var xiaozhang = $('#hm').val();
            var stuNum = $('#stunum').val();
            var ip = $('#ip').val();
            var zhuangtai = $('#zt').val();
            var luruTime = $('#lutime').val();
            var shuoming = $('#shuoming').val();
            var fuzebumen = $("#fuzebumen option:selected").text(); //负责部门
            var fuzeren = $("#fuzeren option:selected").text(); //负责人
            var sschengshi = $("#suoshuchengshi option:selected").text(); //所属城市

            var cityIndex = $("#suoshuchengshi").get(0).selectedIndex; //选择城市时对应的索引
            //console.log(cityIndex)

            //新数组用来存放文本框输入的值
            var new_data = [{
                cityId: cityIndex + 1,
                headmaster: xiaozhang,
                time: luruTime,
                schoolName: schName,
                status: '接洽中',
                phone: tel,
                schoolAddress: schaddr,
                teacherNum: teaNum,
                kuandailiuliang: kuandai,
                studentNum: stuNum,
                IP: ip,
                description: shuoming,
                department: fuzebumen,
                principal: fuzeren,
                city: sschengshi
            }];
            for (let i = 0; i < new_data.length; i++) {
                schoolArr.push({
                    id: schoolArr[schoolArr.length - 1].id + 1,
                    cityId: cityIndex + 1,
                    headmaster: new_data[i].headmaster,
                    time: new_data[i].time,
                    schoolName: new_data[i].schoolName,
                    status: new_data[i].status,
                    phone: new_data[i].phone,
                    schoolAddress: new_data[i].schoolAddress,
                    teacherNum: new_data[i].teacherNum,
                    kuandailiuliang: new_data[i].kuandailiuliang,
                    studentNum: new_data[i].studentNum,
                    IP: new_data[i].IP,
                    description: new_data[i].description,
                    department: new_data[i].department,
                    principal: new_data[i].principal,
                    city: new_data[i].city,
                    lixiangTime: '',
                    allowTime: '',
                    advice: ''
                })

            }


            //隐藏提示信息
            $('#tel').next().text('');
            $('#sname').next().text('');
        }
        localStorage.setItem('schoolArr', JSON.stringify(schoolArr));

    })
}

//修改学校信息
function updateInfo() {
    //修改按钮的点击事件
    $('.tableAll').on('click', '.updateBtn', function() {
        $('#updateModal').modal('show');
        var schoolname = $(this).parent().parent().children().eq(0).text();
        //console.log(schoolname)
        for (let i = 0; i < schoolArr.length; i++) {
            if (schoolname == schoolArr[i].schoolName) {
                //取出数组中的值，呈现在修改界面中
                $('#updateSchool').text(schoolArr[i].schoolName);
                $('#updateAddr').text(schoolArr[i].schoolAddress);
                $('#updateCity').text(schoolArr[i].city);
                $('#updateshijian').text(schoolArr[i].time);
                $('#updatebumen').text(schoolArr[i].department);
                $('#updatefuzeren').text(schoolArr[i].principal);
                $('#updatezhuangtai').text(schoolArr[i].status);
                $('#updateshuoming').text(schoolArr[i].description);

                $('#updatelixiang').text(schoolArr[i].lixiangTime);
                $('#updateAllow').text(schoolArr[i].allowTime);
                $('#updateAdvice').text(schoolArr[i].advice);

                $('#updatetel').val(schoolArr[i].phone);
                $('#updatexiaozhang').val(schoolArr[i].headmaster);
                $('#updatelaoshi').val(schoolArr[i].teacherNum);
                $('#updatexuesheng').val(schoolArr[i].studentNum);
                $('#updatekuandai').val(schoolArr[i].kuandailiuliang);
                $('#updateId').val(schoolArr[i].IP);
            }
        }
    })

    //确认修改按钮
    $('#yesUpdate').click(function() {
        $('#updateModal').modal('hide');
        $('.tableAll tbody tr').remove();
        //获取文本框输入的值
        var tel = $('#updatetel').val();
        var xiaozhang = $('#updatexiaozhang').val();
        var teacherNum = $('#updatelaoshi').val();
        var stuNum = $('#updatexuesheng').val();
        var kuandai = $('#updatekuandai').val();
        var ip = $('#updateId').val();
        //获得修改界面里的学校名字
        var schoolname = $('#updateSchool').text();

        console.log(schoolname)
        for (let i = 0; i < schoolArr.length; i++) {
            if (schoolname == schoolArr[i].schoolName) {
                schoolArr[i].phone = tel;
                schoolArr[i].headmaster = xiaozhang;
                schoolArr[i].teacherNum = teacherNum;
                schoolArr[i].studentNum = stuNum;
                schoolArr[i].kuandailiuliang = kuandai;
                schoolArr[i].IP = ip;
            }
        }

        localStorage.setItem('schoolArr', JSON.stringify(schoolArr));
    })
}

//查看学校信息
function showSchoolInfo() {


    $('.tableAll').on('click', '.lookBtn', function() {
        $('#chakanModal').modal("show");
        //点击查看按钮时，整行颜色变为透明。但是失败了
        //$(this).parent().parent().css('backgroundColor','transparent');
        //console.log($(this).parent().parent())
        var schoolname = $(this).parent().parent().children().eq(0).text();
        //console.log(schoolname)
        $('.tableRecord tbody tr').remove();
        for (var i = 0; i < schoolArr.length; i++) {
            if (schoolname == schoolArr[i].schoolName) {
                $('#lookSchool').text(schoolArr[i].schoolName);
                $('#lookAddr').text(schoolArr[i].schoolAddress);
                $('#lookCity').text(schoolArr[i].city);
                $('#lookshijian').text(schoolArr[i].time);
                $('#lookbumen').text(schoolArr[i].department);
                $('#lookfuzeren').text(schoolArr[i].principal);
                $('#lookzhuangtai').text(schoolArr[i].status);
                $('#lookshuoming').text(schoolArr[i].description);

                $('#looklixiang').text(schoolArr[i].lixiangTime);
                $('#lookAllow').text(schoolArr[i].allowTime);
                $('#lookAdvice').text(schoolArr[i].advice);

                $('#looktel').text(schoolArr[i].phone);
                $('#lookxiaozhang').text(schoolArr[i].headmaster);
                $('#lookteaNum').text(schoolArr[i].teacherNum);
                $('#lookstuNum').text(schoolArr[i].studentNum);
                $('#lookkuandai').text(schoolArr[i].kuandailiuliang);
                $('#lookip').text(schoolArr[i].IP);

                //获取我当前查看的学校的id
                var id = schoolArr[i].id;
                //console.log(id);
                //找到查看的学校对应的沟通记录，并将记录添加到沟通记录表中
                for (var j = 0; j < communication.length; j++) {
                    //communication[j].index=j;
                    if (id === communication[j].schoolid) {
                        //console.log(communication[j]);
                        $('.tableRecord tbody').append(`<tr>
                                <td>${communication[j].comTime}</td>
                                <td>${communication[j].comXiaofang}</td>
                                <td>${communication[j].comPos}</td>
                                <td>${communication[j].comWofang}</td>
                                <td>${communication[j].comNeirong}</td>
                            </tr>
            `);
                    }
                }
            }
        }
    })
}

//添加沟通记录
function addGouTongJiLu() {

    var schooId;
    //选中当前点击的行，获取当前学校的id，传参后，添加对应学校的沟通记录
    $('.tableAll').on('click', 'tbody tr', function() {
        $('.tableAll tbody tr').css('background-color', 'transparent');
        $(this).css('backgroundColor', '#6D6058');
        //console.log($(this));
        var schoolname = $(this).children().eq(0).text();
        //console.log(schoolname)
        for (var i = 0; i < schoolArr.length; i++) {
            if (schoolname == schoolArr[i].schoolName) {
                //选中一行后，这个学校对应的id
                schooId = schoolArr[i].id;
            }
        }
    })

    //添加沟通记录按钮
    $('#addCommunication').click(function() {
        if (schooId == null) {
            $('#tishiModal3').modal("show");
        } else {
            $('#addCommunicationModal').modal("show");
            //清空上一条未清空的数据
            $('#comtime').val('');
            $('#comxiaofang').val('');
            $('#comzhiwu').val('');
            $('#comlainxiren').val('');
            $('#shuomings').val('');

            $('#comxiaofang').next().text('');
            $('#comzhiwu').next().text('');
            $('#comlainxiren').next().text('');
        }

    })

    //添加按钮
    $('.addGTJL').click(function() {

        if ($('#comtime').val().length == 0) {
            $('#comtime').next().text('请选择时间');
            $('#comtime').next().css('color', 'red');
            return;
        } else if ($('#comxiaofang').val().length == 0) {
            $('#comxiaofang').next().text('人名不能为空');
            $('#comxiaofang').next().css('color', 'red');
            return;
        } else if ($('#comzhiwu').val().length == 0) {
            $('#comzhiwu').next().text('职务不能为空');
            $('#comzhiwu').next().css('color', 'red');
            return;
        } else if ($('#comlainxiren').val().length == 0) {
            $('#comlainxiren').next().text('人名不能为空');
            $('#comlainxiren').next().css('color', 'red');
            return;
        } else {
            //清空文本框后面的提示信息
            $('#comtime').next().text('');
            $('#comxiaofang').next().text('');
            $('#comzhiwu').next().text('');
            $('#comlainxiren').next().text('');
            console.log(schooId);
            //获取文本框内的值
            var gtsj = $('#comtime').val();
            var xflxr = $('#comxiaofang').val();
            var zw = $('#comzhiwu').val();
            var lxr = $('#comlainxiren').val();
            var sm = $('#shuomings').val();

            //添加进沟通记录communication数组内
            communication.push({
                comId: communication[communication.length - 1].comId + 1,
                schoolid: schooId,
                comTime: gtsj,
                comXiaofang: xflxr,
                comPos: zw,
                comWofang: lxr,
                comNeirong: sm
            })
            console.log(communication);
            $('#addCommunicationModal').modal("hide");

            localStorage.setItem('communication', JSON.stringify(communication));
        }


    })
}

//申请立项
function applyProject() {

    //获取系统当前时间
    var time;
    var d = new Date();
    var year = d.getFullYear();
    var month = (d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1);
    var day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate();

    time = year + "-" + month + "-" + day;

    var schoolname; //学校名字
    var status; //学校状态

    $('.tableAll').on('click', 'tbody tr', function() {
        //获取选中的那一行的学校名和状态
        schoolname = $(this).children().eq(0).text();
        status = $(this).children().eq(3).text();
        //console.log(status);
    })


    //申请立项按钮
    $("#applyLiXiang").click(function() {
        //显示模态框
        $('#lixiangModal').modal('show');

        if (status == '推广开展' || status == "待审") {
            $('.applyLiXiang').html(`<span id="schname">项目已${status}</span>`);
        } else if (status == '接洽中' || status == '审核未通过') {
            $('.applyLiXiang').html(`<span id="schname">${schoolname}立项申请已提交，等待批审</span>`);
            for (var i = 0; i < schoolArr.length; i++) {
                if (schoolname == schoolArr[i].schoolName) {
                    schoolArr[i].status = '待审';
                    schoolArr[i].lixiangTime = time;
                    localStorage.setItem('schoolArr', JSON.stringify(schoolArr));
                }
            }
        } else {
            $('#tishiModal1').modal('show');
            $('#lixiangModal').modal('hide');
        }
    })

    //确定按钮
    $('#yesLiXiang').click(function() {
        schoolname = ''; //初始化
        //隐藏模态框
        $('#lixiangModal').modal('hide');
    })
}

//审核
function checkApply() {
    //获取系统当前时间
    var time;
    var d = new Date();
    var year = d.getFullYear();
    var month = (d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1);
    var day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate();
    time = year + "-" + month + "-" + day;

    var schoolname; //学校名字
    var status; //状态

    //选中当前行获取学校名
    $('.tableAll').on('click', 'tbody tr', function() {
        //获取选中的那一行的学校名和状态
        schoolname = $(this).children().eq(0).text();
        status = $(this).children().eq(3).text();
    })

    //审核按钮
    $('#shenhe').click(function() {
        //当状态为待审时，才能被审核
        if (status == '待审') {
            //显示模态框
            $('#shenheModal').modal('show');
            $('#shenAdvice').next().text('');
            for (var i = 0; i < schoolArr.length; i++) {
                if (schoolname == schoolArr[i].schoolName) {
                    $('#shenSchool').text(schoolArr[i].schoolName);
                    $('#shenAddr').text(schoolArr[i].schoolAddress);
                    $('#shenCity').text(schoolArr[i].city);
                    $('#shentime').text(schoolArr[i].time);
                    $('#shenbumen').text(schoolArr[i].department);
                    $('#shenfuzeren').text(schoolArr[i].principal);
                    $('#shenzhuangtai').text(schoolArr[i].status);
                    $('#shenshuoming').text(schoolArr[i].description);
                    $('#shenlixiang').text(schoolArr[i].lixiangTime);

                    $('#shentel').text(schoolArr[i].phone);
                    $('#shenxiaozhang').text(schoolArr[i].headmaster);
                    $('#shenteaNum').text(schoolArr[i].teacherNum);
                    $('#shenstuNum').text(schoolArr[i].studentNum);
                    $('#shenkuandai').text(schoolArr[i].kuandailiuliang);
                    $('#shenip').text(schoolArr[i].IP);
                }
            }
        } else {
            $('#tishiModal2').modal('show');
        }

    })


    //批准立项按钮
    $('#pizhun').click(function() {
        if ($('#shenAdvice').val().length == 0) {
            $('#shenAdvice').next().text('审核内容不能为空');
            $('#shenAdvice').next().css('color', 'red');
            return;
        } else {
            //清空错误提示
            $('#shenAdvice').next().text('');
            for (var i = 0; i < schoolArr.length; i++) {
                if (schoolname == schoolArr[i].schoolName) {
                    schoolArr[i].status = '推广开展';
                    schoolArr[i].advice = $('#shenAdvice').val();
                    schoolArr[i].allowTime = time;
                    localStorage.setItem('schoolArr', JSON.stringify(schoolArr));
                }
            }
            //隐藏模态框
            $('#shenheModal').modal('hide');
            $('#shenAdvice').val('');
        }

    })

    //驳回立项按钮
    $('#bohui').click(function() {
        if ($('#shenAdvice').val().length == 0) {
            $('#shenAdvice').next().text('审核内容不能为空');
            $('#shenAdvice').next().css('color', 'red');
            return;
        } else {
            //清空错误提示
            $('#shenAdvice').next().text('');
            for (var i = 0; i < schoolArr.length; i++) {
                if (schoolname == schoolArr[i].schoolName) {
                    schoolArr[i].status = '审核未通过';
                    schoolArr[i].advice = $('#shenAdvice').val();
                    localStorage.setItem('schoolArr', JSON.stringify(schoolArr));
                }
            }
            //隐藏模态框
            $('#shenheModal').modal('hide');
            $('#shenAdvice').val('');
        }

    })
}

//失去焦点判断输入内容
function loseBlur() {
    //录入新学校
    //学校名
    $('#sname').blur(function() {
        var text = $('#sname').val();
        if (text == '') {
            $('#sname').next().text('不能为空');
            $('#sname').next().css('color', 'red');
        } else {
            $('#sname').next().text('');

        }
    })

    //联系电话
    $('#tel').blur(function() {
        //正则表达式
        var reg = /^1[3|5|7|8|9]\d{9}$/;
        if (reg.test($('#tel').val())) {
            $('#tel').next().text('正确');
            $('#tel').next().css('color', 'green');
        } else {
            $('#tel').next().text('格式不正确');
            $('#tel').next().css('color', 'red');
        }
    })

    //添加沟通记录
    //沟通时间
    $('#comtime').blur(function() {
            var text = $('#comtime').val();
            if (text == '') {
                $('#comtime').next().text('请选择时间');
                $('#comtime').next().css('color', 'red');
            } else {
                $('#comtime').next().text('');
            }
        })
        //校方联系人
    $('#comxiaofang').blur(function() {
        var text = $('#comxiaofang').val();
        if (text == '') {
            $('#comxiaofang').next().text('人名不能为空');
            $('#comxiaofang').next().css('color', 'red');
        } else {
            $('#comxiaofang').next().text('');
        }
    })

    //职务
    $('#comzhiwu').blur(function() {
        var text = $('#comzhiwu').val();
        if (text == '') {
            $('#comzhiwu').next().text('职务不能为空');
            $('#comzhiwu').next().css('color', 'red');
        } else {
            $('#comzhiwu').next().text('');

        }
    })

    //联系人
    $('#comlainxiren').blur(function() {
        var text = $('#comlainxiren').val();
        if (text == '') {
            $('#comlainxiren').next().text('人名不能为空');
            $('#comlainxiren').next().css('color', 'red');
        } else {
            $('#comlainxiren').next().text('');
        }
    })

    //审核里面的审核意见
    $('#shenAdvice').blur(function() {
        var text = $('#shenAdvice').val();
        if (text == '') {
            $('#shenAdvice').next().text('审核内容不能为空');
            $('#shenAdvice').next().css('color', 'red');
        } else {
            $('#shenAdvice').next().text('');
        }
    })
}









//双击查看学校信息
/*function showSchoolInfo() {
    $('tbody').on('dblclick','tr',function () {
       $('#chakanModal').modal('show');
        var schoolname=$(this).children().eq(0).text();
        //console.log(schoolname)

        for(let i=0;i<schoolArr.length;i++) {
            if (schoolname == schoolArr[i].schoolName) {
                $('#lookSchool').text(schoolArr[i].schoolName);
                $('#lookAddr').text(schoolArr[i].schoolAddress);
                $('#lookCity').text(schoolArr[i].city);
                $('#lookshijian').text(schoolArr[i].time);
                $('#lookbumen').text(schoolArr[i].department);
                $('#lookfuzeren').text(schoolArr[i].principal);
                $('#lookzhuangtai').text(schoolArr[i].status);
                $('#lookshuoming').text(schoolArr[i].description);

                $('#looklixiang').text(schoolArr[i].lixiangTime);
                $('#lookAllow').text(schoolArr[i].allowTime);
                $('#lookAdvice').text(schoolArr[i].advice);

                $('#looktel').text(schoolArr[i].phone);
                $('#lookxiaozhang').text(schoolArr[i].headmaster);
                $('#lookteaNum').text(schoolArr[i].teacherNum);
                $('#lookstuNum').text(schoolArr[i].studentNum);
                $('#lookkuandai').text(schoolArr[i].kuandailiuliang);
                $('#lookip').text(schoolArr[i].IP);
            }
        }
    })
}*/